0e57b7c0a8fa2775e3a48d904f44ac6f7e8bed27,server/sonar-server/src/test/java/org/sonar/server/search/FacetsMediumTest.java,FacetsMediumTest,should_ignore_unknown_aggregation_type,#,65

Before Change



  @Test
  public void should_ignore_unknown_aggregation_type() throws Exception {
    esTester.putDocuments(INDEX, TYPE,
      newTagsDocument("noTags"),
      newTagsDocument("oneTag", "tag1"),
      newTagsDocument("twoTags", "tag1", "tag2"),
      newTagsDocument("twoTags", "tag1", "tag2", "tag3"),
      newTagsDocument("twoTags", "tag1", "tag2", "tag3", "tag4"));
    SearchRequestBuilder search = esTester.client().prepareSearch(INDEX).setTypes(TYPE)
      .addAggregation(AggregationBuilders.cardinality(FIELD_TAGS).field(FIELD_TAGS));

After Change



  @Test
  public void should_ignore_unknown_aggregation_type() throws Exception {
    esTester.index(INDEX, TYPE, "noTags", newTagsDocument("noTags"));
    esTester.index(INDEX, TYPE, "oneTag", newTagsDocument("oneTag", "tag1"));
    esTester.index(INDEX, TYPE, "twoTags", newTagsDocument("twoTags", "tag1", "tag2"));
    esTester.index(INDEX, TYPE, "threeTags", newTagsDocument("threeTags", "tag1", "tag2", "tag3"));
    esTester.index(INDEX, TYPE, "fourTags", newTagsDocument("fourTags", "tag1", "tag2", "tag3", "tag4"));
    SearchRequestBuilder search = esTester.client().prepareSearch(INDEX).setTypes(TYPE)
      .addAggregation(AggregationBuilders.cardinality(FIELD_TAGS).field(FIELD_TAGS));